<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<body>
<head>
    <%@ include file="/WEB-INF/admin/common/base.jsp" %>
    <jsp:include page="/WEB-INF/admin/common/head.jsp"/>
    <title>Jblog admin</title>
</head>


<div id="wrapper">
    <!-- Navigation -->
    <jsp:include page="/WEB-INF/admin/common/navi.jsp"/>

    <div id="page-wrapper" style="min-height: 402px;">
        <div class="container-fluid">
            <div class="row">


                <div class="col-lg-4">
                    <form role="form" action="<%=adminBasePath%>category/categoryAdd" name="categoryform" id="categoryform" method="post">
                        <input type="hidden" name="id" value="">

                        <div class="form-group">
                            <h1 class="page-header">添加新分类目录</h1>
                        </div>

                        <c:if test="${!empty errors}">
                            <div class="form-group has-error">
                                <c:forEach items="${errors}" var="error">
                                    <label class="control-label">${error}</label><br>
                                </c:forEach>
                            </div>
                        </c:if>

                        <div class="form-group">
                            <label>分类名</label>
                            <input class="form-control" name="name">
                        </div>
                        <div class="form-group">
                            <label>别名</label>
                            <input class="form-control" name="slug">
                        </div>
                        <div class="form-group">
                            <label>父类别</label>
                            <select class="form-control" name="parentId">
                                <option value="0">无</option>
                                <c:forEach items="${list}" var="cate">
                                    <option value="${cate.id}">${cate.name}</option>
                                </c:forEach>
                            </select>
                        </div>
                        <button type="submit" class="btn btn-default">提交</button>
                        <button type="reset" class="btn btn-default">重置</button>
                    </form>
                </div>
                <div class="col-lg-8">
                    <h1 class="page-header">分类列表</h1>

                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <button type="button" class="btn btn-primary" data-id="modify">修改</button>
                            <button type="button" class="btn btn-danger" data-id="delete">删除</button>
                        </div>
                        <div class="panel-body table-bordered" id="tableDiv">


                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>
<!-- /#wrapper -->

<jsp:include page="/WEB-INF/admin/common/bottom.jsp"/>
<script src="<%=basePath%>static/js/common/tableList.js"></script>
<script src="<%=basePath%>static/js/admin/category/categoryView.js"></script>
</body>
</html>
